package com.zdlog.ler.dao;

import com.zdlog.ler.entity.LerProvince;
import com.zdlog.ler.entity.LerUser;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * @program: ler-fast
 * @description:
 * @author: tengxianchao
 * @email: admin@zdlog.com
 * @create: 2018-11-22 17:05
 **/
public interface LerProvinceDao extends JpaRepository<LerProvince,String> {

    @Query(value = "SELECT   * FROM ler_province  GROUP BY province_code",nativeQuery = true)
    List<LerProvince> findByProvince();

    @Query(value = "SELECT * FROM ler_province  WHERE province_code=:provinceCode  GROUP BY city_code",nativeQuery = true)
    List<LerProvince> findByCity(@Param("provinceCode") String provinceCode);

    List<LerProvince> findByCityCode(String cityCode);
}
